import java.awt.Color;
import java.awt.Image;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;

import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;


public class FieldCard extends JPanel implements MouseListener,MouseMotionListener {

	ImageIcon[] myImage;
	
	int posX;
	int posY;
	int getX;
	int getY;
	FieldCard(int x,int y,int upleft,int upright,int downleft,int downright) 
	{
		setBounds(750+y*45,320+x*85,40,80);
		setLayout(null);
		//setBackground(Color.pink);
		addMouseListener(this);
		myImage=new ImageIcon[13];
		this.addMouseListener(this);
		this.addMouseMotionListener(this);
		for(int i=1;i<13;i++)
		{
			myImage[i]= new ImageIcon(new ImageIcon("pic\\"+i+".png").getImage().getScaledInstance(20,40,Image.SCALE_DEFAULT)); 
		}
		
		
	    posX=x;
		posY=y;
		
		JLabel ul=new JLabel();
		ul.setIcon(myImage[upleft]);
		ul.setBounds(0,0,20,40);
		this.add(ul);
		ul.setVisible(true);
		
		JLabel ur=new JLabel();
		ur.setIcon(myImage[upright]);
		ur.setBounds(20,0,20,40);
		this.add(ur);
		ur.setVisible(true);
		
		JLabel dl=new JLabel();
		dl.setIcon(myImage[downleft]);
		dl.setBounds(0,40,20,40);
		this.add(dl);
		dl.setVisible(true);
		
		JLabel dr=new JLabel();
		dr.setIcon(myImage[downright]);
		dr.setBounds(20,40,20,40);
		this.add(dr);
		dr.setVisible(true);
		
		
		setVisible(true);
		repaint();
}
	@Override
	public void mouseClicked(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void mousePressed(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void mouseReleased(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void mouseEntered(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void mouseExited(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void mouseDragged(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void mouseMoved(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}
}
